package com.example.controller;

import java.util.Arrays;
import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.pojo.CusDevPlan;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.example.vo.ResultVo;
import com.github.pagehelper.PageInfo;
import com.example.pojo.CustomerLoss;
import com.example.service.ICustomerLossService;
import io.swagger.annotations.Api;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wsl
 * @since 2022-05-06
 */
@RestController
@RequestMapping("/customerLoss")
@Api(tags = "",value = "")
@CrossOrigin(allowCredentials = "true")
public class CustomerLossController {

    @Autowired
    private ICustomerLossService customerLossService;

    /**
     * 查询所有
     */
    @GetMapping("")
    public List<CustomerLoss> displayCustomerLossInfo(){
        return customerLossService.selectAll();
    }

    @ApiOperation(value = "查询")
    @GetMapping("/pager")
    public PageInfo<CustomerLoss> getCustomerLossPageInfo(@RequestParam(defaultValue = "1") Integer pageNum,
                                                          @RequestParam(defaultValue = "5") Integer pageSize,
                                                          String cusName,
                                                          String cusNo,
                                                          Integer state) {
        return customerLossService.electByPager(pageNum,pageSize,cusName,cusNo,state);
    }

}
